import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  // 主页  
  {
    path: '/',
    name: 'home',
    component: Home,
    // redirect:''
  },
  // 分类
  {
    path: '/list',
    name: 'list',
    component: () => import('../views/List.vue'),
  },
  // 购物车
  {
    path: '/cart',
    name: 'cart',
    component: () => import('../views/Cart.vue'),
  },
  // 我的
  {
    path: '/my',
    name: 'my',
    component: () => import('../views/My.vue'),
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('../views/Login.vue'),
  },
  {
    path: '/register',
    name: 'register',
    component: () => import('../views/Register.vue'),
  },
  {
    path: '/addressindex',
    name: 'addressindex',
    component: () => import('../views/AddressIndex.vue'),
  },
  // 测试专用
  // {
  //   path: '/texting1',
  //   name: 'register',
  //   component: () => import('../views/testing1.vue'),
  // },

]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
